package com.magicsoft.share.adapter.share;

import android.support.annotation.LayoutRes;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.my.ArticleList;

/**
 * Created by lyf on 2017/10/26/026.
 * 首页有图片的文章列表
 */

public class ArticleListOtherAdapter extends BaseQuickAdapter<ArticleList.ListBean, BaseViewHolder> {


    public ArticleListOtherAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ArticleList.ListBean item) {
        helper.addOnClickListener(R.id.iv_head);
        helper.setText(R.id.tv_title, item.getTitle());
helper.setText(R.id.tv_date,item.getModifyTime());
        helper.setText(R.id.tv_read, item.getBrowseNum() + "");
        helper.setText(R.id.tv_like, item.getLoveNum() + "");
        helper.setText(R.id.tv_comment, item.getCommentNum() + "");
        ImageView iv_cover = helper.getView(R.id.iv_cover);
        ImageView iv_head = helper.getView(R.id.iv_head);
        ImageView iv_like = helper.getView(R.id.iv_like);
        Glide.with(mContext).load(item.getCover()).into(iv_cover);
//        if (item.isThumbsUp()) {
//            Glide.with(mContext).load(R.drawable.heart_black).into(iv_like);
//        } else {
//            Glide.with(mContext).load(R.drawable.heart).into(iv_like);
//        }

    }

}
